package iO;

import java.io.*;

/**
 * @Author: Miyako
 * @Date: 2024-07-16-15:33
 * @Description: BufferedOutputStream与BufferedInputStream流，自带缓冲区的流
 */
public class FileCopyDemo03 {
    public static void main(String[] args) throws IOException {
        String str = "./13.png";
        BufferedInputStream bInt = new BufferedInputStream(new FileInputStream(str));
        BufferedOutputStream bOut = new BufferedOutputStream(//处理流
                new FileOutputStream("./15.png"));//节点流
        byte[] bit = new byte[1024];
        int len;
        while ((len = bInt.read(bit)) != -1) {
            bOut.write(bit, 0, len);
        }
        bOut.flush();
        bInt.close();
        bOut.close();
        long a = new File("./a.png").length();
        System.out.println(a);

    }
}
